<html>
<head>
<meta NAME="author" CONTENT="Tamas Vertse">
    <script type="text/javascript" src="../../sh_main.js"></script>
    <script type="text/javascript" src="../../sh_javascript.js"></script>
    <script type="text/javascript" src="../../sh_html.js"></script>
    <link REL ="stylesheet" TYPE="text/css" HREF="../../sh_nedit.css" TITLE="Style">
<link REL ="stylesheet" TYPE="text/css" HREF="../../../marvinmanuals.css" TITLE="Style">
<title>MarvinSketch Example - Resizeable sketcher in a separate window</title>
</head>
<body onload="sh_highlightDocument();">

<h1>MarvinSketch Example - Resizeable sketcher in a separate window</h1>

<p>Click on the link below to open a separate browser window with a MarvinSketch applet. The applet size is changing as you resize the new browser window.</p>
<p><a href="msketch-resize.html">msketch-resize.html</a></p>
<p>The html code of the resizeable applet page is as follows:</p>
<pre class="sh_html">
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Resizeable sketcher&lt;/title&gt;
&lt;/head&gt;
&lt;body topmargin='0' leftmargin='0' marginwidth='0' marginheight='0' onLoad='resize()' onResize='resize()'&gt;
&lt;SCRIPT LANGUAGE="JavaScript"&gt;
</pre>
<pre class="sh_javascript">
    function resize() {
        if (navigator.appName.indexOf("Microsoft") != -1) {
            window.width=document.body.clientWidth;
            window.height = document.body.clientHeight;
        } else {
            var netscapeScrollWidth=15;
            window.width = window.innerWidth - netscapeScrollWidth;
            window.height = window.innerHeight - netscapeScrollWidth;
        }
        document.MSketch.width = window.width;
        document.MSketch.height = window.height;
        window.scroll(0,0);
    }
    window.onResize = resize;
    window.onLoad = resize;
</pre>
<pre class="sh_javascript">
&lt;script LANGUAGE='JavaScript1.1' SRC='../../../marvin.js'&gt;&lt;/script&gt;
&lt;script LANGUAGE='JavaScript1.1'&gt;
msketch_name = 'MSketch';
msketch_begin('../../..', window.innerWidth, window.innerHeight);
try {
    msketch_end();
} catch(e) {
}
</pre>
<pre class="sh_html">
&lt;/script&gt;
&lt;/body&gt;&lt;/html&gt;
</pre>

</body>
</html>
